package com.xbd.flex.controller;

import com.xbd.flex.dto.UserDTO;
import com.xbd.flex.result.ResponseMsg;
import com.xbd.flex.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    @PostMapping("/listUserPage")
    public ResponseMsg listUserPage(@RequestBody UserDTO userDTO) {
        return ResponseMsg.success(userService.listUserPage(userDTO));
    }

    @GetMapping("/listUser")
    public ResponseMsg listUser() {
        return ResponseMsg.success(userService.listUser());
    }
}
